package snuggle.jabber.utils;

import java.util.Date;
import java.util.TimerTask;

import org.apache.log4j.Logger;
import org.jivesoftware.smack.SmackException.NotConnectedException;

import snuggle.jabber.bot.SnuggleBot;

public class ReminderTask extends TimerTask {
	
	private String message;

	private static Logger logger = Logger.getLogger(ReminderTask.class);

	@Override
	public void run() {
		try {
			logger.info("Executing task at " + new Date());
			SnuggleBot.getMessageUtils().broadcast(SnuggleBot.getRoster(), "snugglebot@jabber.shhh-eve.com", "all", message);
		} catch (NotConnectedException e) {
			e.printStackTrace();
		}
	}
	
	public ReminderTask(String message) {
		this.message = message;
	}

}
